import { post } from '@/request/http'
import store from '@/store'

//货种维护 接口

// 列表数据接口
// export const MaintainList = () =>
//   post(
//     '/FTKJWLHYPT/base/pdtKindList',
//     {
//       Data: {
//         Parameters: {
//           FTKJWLHYPT: {
//             pdkEptId:store.state.user.FLT_UUID_DX_H,
//           }
//         },
//       }
//     }
//   )
//新增
export const addMaintain = (data) =>
  post(
    '/FTKJWLHYPT/base/addProductKindModel',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            pdkPdkId:data.pdkPdkId,
            pdkName:data.pdkName,
            pdkCode:data.pdkCode,
            pdkGoodstypefg:data.pdkGoodstypefg,
            pdkRemark:data.pdkRemark,
            pdkCreateuser:store.state.user.USR_CODE_DX_H,
            pdkCreatetm:data.pdkCreatetm,
            pdkEptId:store.state.user.FLT_UUID_DX_H
          }
        },
      }
    }
  )

//上级下拉
// export const addMaintainXL = (data) =>
//   post(
//     '/FTKJWLHYPT/base/pdtKind',
//     {
//       Data: {
//         Parameters: {
//           FTKJWLHYPT: {
//             pdkName:data.pdkName,
//             pdkEptId:data.pdkEptId,
//           }
//         },
//       }
//     }
//   )
//编辑
export const editMaintain = (data) =>
  post(
    '/FTKJWLHYPT/base/editProductKindModel',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            pdkId:data.pdkId,
            pdkPdkId:data.pdkPdkId ,
            pdkName:data.pdkName ,
            pdkCode:data.pdkCode ,
            pdkGoodstypefg:data.pdkGoodstypefg,
            pdkRemark:data.pdkRemark ,
            pdkModifyuser:store.state.user.USR_CODE_DX_H,
            pdkModifytm:data.pdkModifytm ,
            pdkEptId:store.state.user.FLT_UUID_DX_H
          }
        },
      }
    }
  )
//删除
export const delMaintain = (data) =>
  post(
    '/FTKJWLHYPT/base/deletePdtKindModel',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            pdkId: data.pdkId,
            pdkEptId: store.state.user.FLT_UUID_DX_H
          }
        },
      }
    }
  )

//上级下拉框
export const delMaintainXL = ({
  pdkName,
  // PageIndexs,
  // PageSizes
}) =>
  post(
    '/FTKJWLHYPT/base/pdtKindTree',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            pdkName,
            pdkEptId:store.state.user.FLT_UUID_DX_H
          }
          // PageIndexs: {
          //   FTKJWLHYPT:PageIndexs
          // },
          // PageSizes: {
          //   FTKJWLHYPT:PageSizes
          // }
        },
      }
    }
  )
